package cn.wolfcode.luowowo.search.service;

import cn.wolfcode.luowowo.search.query.StrategySearchQuery;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * 搜索服务
 */
public interface ISearchService {

    /**
     * 初始化索引
     */
    void initIndex();

    /**
     * 全文搜索并高亮显示
     * @return
     */
    <T> List<T> searchWithHighlight(String index, String type, Class<T> clz, String keyword, String... fields);


    <T> Page<T> searchWithHighlight(String index, String type, Class<T> clz, StrategySearchQuery qo, String... fields);


}

